function fctloginFocus()
{
	document.getElementById("login_name").focus();	
	return false;
}
function ajaxlogin_val(objForm)
{
	var sURL = "ajaxlogin_val.asp";	
	var sLogin_name = "";
	var sLogin_pwd = "";
	
	//... Retrieving values ...//
	sLogin_name = document.getElementById("login_name").value;
	sLogin_pwd = document.getElementById("login_pwd").value;	
		
	//===================//
	//... Validations ...//
	//===================//	
	if(sLogin_name=='')
	{
			alert("Please type a valid login name.");
			document.getElementById("login_name").focus();
			return false;
	}
	if(sLogin_pwd=='')
	{
			alert("Please type a valid password.");
			document.getElementById("login_pwd").focus();
			return false;
	}
	
	//... Ajax to find possible names entered before ...//
	try
	{  
		 // Firefox, Opera 8.0+, Safari  
		 xmlHttp=new XMLHttpRequest();  
	 }
	 catch (e)
	 { 
		 // Internet Explorer  
		 try
		 {    
			   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
		 }
		 catch (e)
		 {    
			   try
			   {      
					 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");     
			   }
			   catch (e)
			   {      
					 //alert("Your browser does not support AJAX!");      
					 return false;      
			   }    
		 }  
	 }	   
	 xmlHttp.onreadystatechange=function()
	 {
		 if(xmlHttp.readyState==4)
		 {
			   sResponse = xmlHttp.responseText;
			   if(sResponse != "OK")
			   {
					alert(sResponse);
					document.getElementById("login_name").focus();
					return false;
			   }
			   else
			   {
					objForm.submit();
					return true;
			   }
		 }
	 }
	 sURL = sURL + "?" + "login_name=" + sLogin_name + "&" + "login_pwd=" + sLogin_pwd;
	 xmlHttp.open("GET", sURL, true);
	 xmlHttp.send(null);
}
